<template>
  <div>
    <div class="list-box">
      <div class="head-box">
        <search-form
          ref="searchForm"
          :search-config="searchConfig"
          :label-width="150"
          @clear="clearSearch"
          @search="handleSearch"
        />
      </div>
      <c-permission-tabs v-model="activeType" code="tab">
        <el-tab-pane label="全部" name="all" opt-code="all">
          <List
            :active-type="activeType"
            :serach-filters="searchFilters"
            type="all"
          />
        </el-tab-pane>
        <el-tab-pane label="待整改" name="awaitRectify" opt-code="awaitRectify">
          <List :active-type="activeType" :serach-filters="searchFilters" type="awaitRectify" />
        </el-tab-pane>
        <el-tab-pane label="整改资料初审" name="rectifyAudit" opt-code="rectifyAudit">
          <List :active-type="activeType" :serach-filters="searchFilters" type="rectifyAudit" />
        </el-tab-pane>
      </c-permission-tabs>
    </div>
  </div>
</template>

<script>
import List from './List'

export default {
  name: 'ProblemRectify',
  components: { List },
  data() {
    return {
      activeType: '',
      searchFilters: [],
      noRequest: false,
      searchConfig: [
        { label: '走访整改任务号', prop: 'rectifyNo', type: 'text', value: '', placeholder: '', filter: true },
        { label: '走访任务号', prop: 'patrolTaskNo', type: 'text', value: '', placeholder: '', filter: true },
        { label: '门店名称', prop: 'shopName', type: 'text', value: '', placeholder: '', filter: true },
        {
          type: 'select',
          prop: 'schedule',
          label: '走访整改进度',
          filter: true,
          config: {
            filterable: false, // 是否允许输入关键字搜索
            remoteUrl: '/data-dict/api/v2/dictionary/PATROL_QUESTION_STATUS?appCode=slm&domainCode=marketing',
            defaultProps: { label: 'dictName', value: 'dictCode' }
          }
        },
        {
          type: 'select',
          prop: 'classification',
          label: '整改问题分类',
          filter: true,
          config: {
            filterable: false, // 是否允许输入关键字搜索
            remoteUrl: '/data-dict/api/v2/dictionary/RECTIFICATION_CLASSIFICATION?appCode=slm&domainCode=marketing',
            defaultProps: { label: 'dictName', value: 'dictCode' }
          }
        }
      ]
    }
  },
  computed: {},
  watch: {},
  mounted() {
  },
  created() {
  },
  methods: {
    // 清空搜索条件
    clearSearch(data) {
      this.searchFilters = []
    },

    // 获取搜索条件
    handleSearch(data) {
      this.searchFilters = data.filtersRaw
    }
  }
}
</script>

<style lang="scss" scoped>
.colorSetRed{
  color: red;
}
.head-box{
}
.tableUpButton{
  margin: 10px;
}
  .button{
    margin: 0px !important;
    width: 100px;
    border: 1px solid #dcdcdc;
  }
  .down-button{
    color: black;
  }
  .form{
    border: 1px solid #dcdcdc;
    padding: 20px;
  }
</style>
